<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>商品分类</title>
	<link rel="stylesheet" href="<?= AC ?>order-goods.css">
</head>
<body>
	<div class="table-wrap">
		<div class="table-main">
			<div class="ibox-title">
				<h3>商品分类</h3>
			</div>
			<div class="ibox-content">	
				<form action="" class="form-main">
					<!-- <div class="form-btn">
						<a href="index.php?c=category&m=add" target="myIframe">+ 添加分类</a>
					</div> -->
					<!-- <div class="form-search">
						<input type="text"  class="form-control" value placeholder="输入分类名称" >
						<input type="submit" class="search-btn" value="搜索">
					</div> -->
				</form>
				<table class="list-table">
					<thead>
						<tr>
                            <th>编号</th>
                            <th>分类名称</th>
                            <th>父类ID</th>      
                            <th>分类路径</th>
                            <th>状态</th>
                            <!-- <th>排序</th> -->
                            <th>操作</th>
                       </tr>
					</thead>
					<tbody>					
						<tr>
						<?php if(empty ($res)):?>
						<td colspan=6>暂无分类数据,请先去添加...
						</td>
						<?php else:?>
						<?php foreach ($res as $k => $v): ?>
							<td><?= $v['id']?></td>
							<td><?= $v['name']?></td>							
							<td><?= $v['pid']?></td>
							<td><?= $v['path']?></td>
							<td><a href="index.php?c=category&m=display&id=<?= $v['id']?>"><?= $v['display']==1?'上架':'下架' ?></a>
							</td>
							<td>
								<div class="btn-group">
								
									<a href="index.php?c=category&id=<?= $v['id']?>" class="btn-white">查看子类</a>
									<a href="index.php?c=category&m=add&id=<?= $v['id']?>&path=<?= $v['path']?>" class="btn-white">添加子类</a>
									<a href="index.php?c=category&m=edit&id=<?= $v['id']?>"
									 class="btn-white">编辑</a>
									<a href="index.php?c=category&m=doDel&id=<?= $v['id']?>" class="btn-white">删除</a>
								</div>
							</td>
						</tr>
					<?php endforeach ?>	
					</tbody>
					<?php endif; ?>
				</table>
			</div>
		</div>
	</div>
</body>
</html>